/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Alvaro
 */
@Embeddable
public class TprovinciasPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "CODI_DEPA_DPT")
    private String codiDepaDpt;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "CODI_PROV_TPR")
    private String codiProvTpr;

    public TprovinciasPK() {
    }

    public TprovinciasPK(String codiDepaDpt, String codiProvTpr) {
        this.codiDepaDpt = codiDepaDpt;
        this.codiProvTpr = codiProvTpr;
    }

    public String getCodiDepaDpt() {
        return codiDepaDpt;
    }

    public void setCodiDepaDpt(String codiDepaDpt) {
        this.codiDepaDpt = codiDepaDpt;
    }

    public String getCodiProvTpr() {
        return codiProvTpr;
    }

    public void setCodiProvTpr(String codiProvTpr) {
        this.codiProvTpr = codiProvTpr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codiDepaDpt != null ? codiDepaDpt.hashCode() : 0);
        hash += (codiProvTpr != null ? codiProvTpr.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TprovinciasPK)) {
            return false;
        }
        TprovinciasPK other = (TprovinciasPK) object;
        if ((this.codiDepaDpt == null && other.codiDepaDpt != null) || (this.codiDepaDpt != null && !this.codiDepaDpt.equals(other.codiDepaDpt))) {
            return false;
        }
        if ((this.codiProvTpr == null && other.codiProvTpr != null) || (this.codiProvTpr != null && !this.codiProvTpr.equals(other.codiProvTpr))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.TprovinciasPK[ codiDepaDpt=" + codiDepaDpt + ", codiProvTpr=" + codiProvTpr + " ]";
    }
    
}
